caboCity.implement({
	iniMap: function(){
		this.map = []; //Store the worldThings by coordinate.
		this.mapSize;
		this.build = {};
		this.addNewCommand({
			r : 'newMap'
			,answerFun: this.processMapFromServer
		});
	}
	
	/*
	Load a new map sended by server.
	command = {
		wt : [wtype]**i*j
		build : [type]**i*j
	}
	*/
	,processMapFromServer: function(map){
		map.wt.each(function(wtype, coorv){
			//if wtype is a wt valid then
			this.map[coorv] = wtype;
		}, this);
		
		var i = 0;
		Object.each(map.build, function(build){
			//if build is a valid build then
			this.build[i] = build; i++;
		}, this);
		
		this.mapSize = Object.clone(map.macSize);
	}
	,loadUserMapFromServer: function(){
		this.makeAndSendCommand('newMap', null);
	}
});
